package game.components;

import sheep.graphics.Image;
import sheep.math.Vector2;
/**
 *	The brick component containing hasPowerUp and a brick count
 * @see Component
 *  @author Erlend Heimark
 */

public class Brick extends Component{
	
	private boolean hasPowerUp;
	private int brickCount;
	

	/**
	 * Constructor
	 * 
	 * @param image The brick image being used
	 * @param pos The position of the brick
	 * @param brickCount The number of hits the brick can take
	 * @param powerUpFreq Frequency of how often a Brick is made with a powerUp
	 */
	public Brick(Image image, Vector2 pos, int brickCount, float powerUpFreq){
		super(image);
		this.setPosition(pos);
		this.brickCount = brickCount;
		
		if(Math.random()<powerUpFreq) hasPowerUp = true;
	}


	public boolean getPowerUp() {
		return hasPowerUp;
	}

	public int getBrickCount() {
		
		return brickCount;
	}
	
	public void setBrickCount(int i){
		brickCount = i;
	}

	public void setHasPowerUp(boolean hasPowerUp) {
		this.hasPowerUp = hasPowerUp;
	}

}
